/**
 * Game
 * Manage game mecanics and managers
 **/
var Game = function() {
	// Game objects
	this.mLevel = null;
	this.mEnemy = null;
	this.mPlayer = null;
	this.hud = null;
	this.mSpell = null;

	// Game state 
	this.waiting = null;
	this.stop = null;
	this.cleared = null;

	this.imgData = null;

	this.init = function() {
		// log('*** INIT GAME ***');

		this.mLevel = new Level();
		this.mLevel.init();
	}

	this.start = function() {
		// log('*** START GAME ***');

		this.stop = false;
		this.waiting = false;
	}

	this.clear = function() {

		this.stop = true;
		this.cleared = false;
	}

	this.update = function() {

		// On écoute les évènement input clavier et souris
		input.listen();

		this.mLevel.update();
		this.render();
	}

	this.render = function() {
		this.mLevel.render();
	}

	this.currentPlayer = function() {
		return this.mPlayer.entities[0];
	}

};
